<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员管理-有点</title>
<link rel="stylesheet" type="text/css" href="<?php echo Url::base(); ?>/resource/css.css">
<link rel="stylesheet" type="text/css" href="<?php echo Url::base(); ?>/resource/pageGroup.css">
<script type="text/javascript" src="<?php echo Url::base(); ?>/resource/jquery.js"></script>
<script type="text/javascript" src="<?php echo Url::base(); ?>/resource/jquery-1.js"></script>

<script src="<?php echo Url::base();?>jquery.min.js" type="text/javascript"></script>
<script src="<?php echo Url::base(); ?>jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo Url::base(); ?>uploadify.css">

<script charset="utf-8" src="<?php echo Url::base();?>kindeditor-4.1.7/kindeditor.js"></script>
<script charset="utf-8" src="<?php echo Url::base();?>kindeditor-4.1.7/lang/zh_CN.js"></script>
<script charset="utf-8" src="<?php echo Url::base();?>kindeditor-4.1.7/plugins/code/prettify.js"></script>
<!-- <script type="text/javascript" src="js/page.js" ></script> -->
</head>


<!-- <script type="text/javascript" src="js/page.js" ></script> -->
</head>
<body>

	<form method="post" action="<?php echo Url::base(); ?>index.php/pageconfigm/addPageconfig">
		名称：<input type="text" name="name"/><br>
		类型模块:
		<select name="type" onchange="change(this)">
			<option value="底部模块1">底部模块1</option>
			<option value="底部模块2">底部模块2</option>
			<option value="底部模块3">底部模块3</option>
			<option value="底部模块4">底部模块4</option>
			<option value="底部联系方式">底部联系方式</option>
			<option value="配送时间">配送时间</option>
			<option value="配送时间说明">配送时间说明</option>
			<option value="二维码">二维码</option>
		</select>
		<br>
		排序:<input type="text" name="sort"><br>

<div style="display:none;" id="timediv">配送时间:<input type="text" name="time" ><br></div>
<div style="display:none;" id="timedescdiv">配送时间说明:<input type="text" name="timedesc" ><br></div>
<div style="display:none;" id="contactdescdiv">底部联系方式:<input type="text" name="contact" ><br></div>
<div style="display:none;" id="textdiv">连接:<input type="text" name="href" ><br></div>
<div id="longtextdiv">详细页面内容<textarea name="content" style="width:700px;height:200px;"></textarea><br></div>

<div style="display:none;" id="pic">
	主图:
	<input id="file_upload" name="name" type="file" multiple="true"><br>
	<input attr="file_upload"  name="uploadPhone" type="hidden" multiple="true"><br>
</div>
		<input type="submit" value="提交"/>
	</form>

	<script>
	function change(obj){
		var name=$(obj).val();
		if(name.indexOf("底部模块")>=0){
			$("#textdiv").hide();
			$("#pic").hide();
			$("#timediv").hide();
			$("#contactdescdiv").hide();
			$("#longtextdiv").show();
			$("#timedescdiv").hide();
		}else if(name=="配送时间说明"){
			$("#textdiv").hide();
			$("#pic").hide();
			$("#longtextdiv").hide();
			$("#timedescdiv").show();
			$("#timediv").hide();
			$("#contactdescdiv").hide();
		}else if(name=="配送时间"){
			$("#textdiv").hide();
			$("#pic").hide();
			$("#longtextdiv").hide();
			$("#timediv").show();
			$("#timedescdiv").hide();
			$("#contactdescdiv").hide();
		}else if(name=="底部联系方式"){
			$("#textdiv").hide();
			$("#pic").hide();
			$("#longtextdiv").hide();
			$("#contactdescdiv").show();
			$("#timediv").hide();
			$("#timediv").hide();
		}else{
				$("#textdiv").hide();
			$("#timediv").hide();
			$("#longtextdiv").hide();
			$("#pic").show();
			$("#timedescdiv").hide();
			$("#contactdescdiv").hide();
		}
	}
	$(function(){
			$('#file_upload').uploadify({

		'formData'     : {
		},
		'swf'      : '<?php echo Url::base(); ?>uploadify.swf',
		'uploader' : '<?php echo Url::base(); ?>index.php/productm/upload',
		'onUploadSuccess':function(file,data,response){
			if(data== 'false'){
				alert("图片格式不正确请检查")
			}else{
				alert("上传成功")
				$("input[attr='file_upload']").val(data)

			}}

		});
	})
KindEditor.ready(function(K) {
	var editor1 = K.create('textarea[name="content"]', {
		cssPath : '<?php echo Url::base();?>kindeditor-4.1.7/plugins/code/prettify.css',
		uploadJson : '<?php echo Url::base();?>kindeditor-4.1.7/php/upload_json.php',
		fileManagerJson : '<?php echo Url::base();?>kindeditor-4.1.7/php/file_manager_json.php',
		allowFileManager : true,
		afterCreate : function() {
			var self = this;
			K.ctrl(document, 13, function() {
				self.sync();
				K('form[name=example]')[0].submit();
			});
			K.ctrl(self.edit.doc, 13, function() {
				self.sync();
				K('form[name=example]')[0].submit();
			});
		}
	});
	prettyPrint();
});
</script>

</body></html>